package com.jc.service.common.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 拦截器配置类
 */
@Configuration
@ConfigurationProperties(prefix = "app.interceptor")
public class Config {
    
    /**
     * 租户ID验证拦截器配置
     */
    private TenantIdValidation tenantIdValidation = new TenantIdValidation();
    
    public TenantIdValidation getTenantIdValidation() {
        return tenantIdValidation;
    }
    
    public void setTenantIdValidation(TenantIdValidation tenantIdValidation) {
        this.tenantIdValidation = tenantIdValidation;
    }
    
    /**
     * 租户ID验证配置
     */
    public static class TenantIdValidation {
        /**
         * 租户ID路径匹配正则表达式
         */
        private String pathPattern = "/api/[^/]+/tenants/([^/]+)/";
        
        public String getPathPattern() {
            return pathPattern;
        }
        
        public void setPathPattern(String pathPattern) {
            this.pathPattern = pathPattern;
        }
    }
}